package o;

import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.text.TextUtils;

public class dep {
    private static final String ˋ = dep.class.getSimpleName();
    private static dep ˏ;
    private static long ॱ = 10000;
    private String ˊ;
    private SharedPreferences ˎ = cfo.ˏ(dei.ˎ(), "wlanapp", 0);

    private dep() {
    }

    public static dep ˊ() {
        if (ˏ == null) {
            ˏ = new dep();
        }
        return ˏ;
    }

    public String ˋ() {
        if (TextUtils.isEmpty(this.ˊ)) {
            String string = this.ˎ.getString("wlan.appkey.new", "");
            Object string2 = this.ˎ.getString("wlan.iv.appkey.new", "");
            if (!TextUtils.isEmpty(string2)) {
                try {
                    this.ˊ = cev.ˋ(string, cda.ˏ(string2));
                } catch (Exception e) {
                    Logger.ˏ(ˋ, "getSecriteKey() " + e.toString());
                }
            }
        }
        return this.ˊ;
    }

    public void ˋ(String str, String str2) {
        this.ˊ = str;
        if (!TextUtils.isEmpty(str2) && !TextUtils.isEmpty(this.ˊ)) {
            try {
                String ˋ = cev.ˋ(this.ˊ, cda.ˏ(str2));
                Editor edit = this.ˎ.edit();
                edit.putString("wlan.appkey.new", ˋ).commit();
                edit.putString("wlan.iv.appkey.new", str2).commit();
            } catch (Exception e) {
                deg.ˏ.ˊ(ˋ, "setSecriteKey(String key, String iv) " + e.toString());
            }
        }
    }
}
